{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=236
  Verdict: Accepted
}
var n,c:longint;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
read(n);
if sqr(trunc(sqrt(n)))<>n then begin
   if sqr(trunc(sqrt(n)))+1<>n then begin
      c:=trunc(sqrt(n));
      write(n-c*2,' ',n-1,' ',n+1,' ',n+(c+1)*2);
   end else begin
       write(n+1,' ',n+(trunc(sqrt(n))+1)*2);
   end;
end else begin
    if n=1 then write(3) else write(n-1,' ',n+trunc(sqrt(n))*2);
end;
end.